package com.microservice.skeleton.upms.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.microservice.skeleton.upms.mapper.RcRoleMapper;
import com.microservice.skeleton.upms.mapper.RcUserMapper;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;

import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;


/**
 * 用户model
 */
@Table(name = "rc_user")
@Data
public class RcUser {
    @NotNull
    private String id;

    /**
     * 头像
     */
    @NotBlank(message = "不能为null")
    private String avatar;

    /**
     * 用户名
     */
    @NotNull
    @Size(min = 4, max = 30)
    private String username;

    //密码
    private String password;

    private String salt;

    private String name;

    private Date birthday;

    private Integer sex;

    @Pattern(regexp = "\\d+@\\w\\.com")
    private String email;

    private String phone;


    @Column(name = "create_time")
    private Date createTime;

    @Column(name = "update_time")
    private Date updateTime;

    /**
     * 审核状态
     */
    @NotNull
    private Status status;

}